package com.my.study.designPatterns.compoundPattern;

public class GreenHeadDuck implements Quackable {

    private Observerable observerable;

    @Override
    public void quack() {
        System.out.println("GreenHeadDuck quack!");
        notifyObservers();
    }

    public GreenHeadDuck() {
        observerable = new Observerable(this);
    }

    @Override
    public void registerObserver(DuckObserver observer) {

        observerable.registerObserver(observer);
    }

    @Override
    public void notifyObservers() {

        observerable.notifyObservers();
    }
}
